<template>
  <view>
    <view class="pt-12 pl-20 pr-20">
      <rich-text :nodes="content"></rich-text>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        content:'',
        index:0
      };
    },
    onLoad(e) {
      this.index = e.index
      this.getInfo()
    },
    methods:{
      getInfo(){
        this.$tools.axiosFromToken('POST','proconfigrich/getById',{id:this.index},'加载中').then(res => {
          if(res.code != 200) return this.$tools.showtt(res.msg)
          let {data:{configurationContent}} = res
          this.content = configurationContent
          if(this.index == 1){
            uni.setNavigationBarTitle({
              title:'用户协议'
            })
          }
          if(this.index == 2){
            uni.setNavigationBarTitle({
              title:'隐私协议'
            })
          }
        })
      }
    }
  }
</script>

<style lang="scss">

</style>
